package com.springCloud.luoqiu.controller;

import com.springCloud.luoqiu.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 洛秋y
 * @date 2020/11/20 14:15
 */
@RestController
public class PaymentController {

    @Resource
    private PaymentService paymentService;

    @GetMapping(value = "/hys/ok")
    public String ok() {
        return paymentService.get();
    }

    @GetMapping(value = "/hys/err")
    public String err() {
        return paymentService.fail();
    }

    @GetMapping(value = "/hys/circle")
    public String circle() {
        return paymentService.paymentCircuitBreaker(-1);
    }
}
